{layout name="layouts/admin" /}
<div class="panel-heading"><span style="color:#298bee">{$datatype?($depname['dep_name']):""}</span>&nbsp;&nbsp;{$datatype==0?"科室列表":"疾病列表"}
   <a style="float:right;margin-top:-6px;" href="/wechatgroup/depadd/0/{$datatype}" class="btn btn-primary">添加{$datatype?"疾病":"科室"}</a>
</div>

<div class="panel-body">
    <div class="box-body">
        <div id="example2_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
            <div class="row">
                <div class="col-sm-12">
                    <table class="table table-hover dataTable" >
                        <thead>
                        <tr>
                            <th>{$datatype?"疾病":"科室"}ID</th>
                            <th>{$datatype?"疾病":"科室"}名称</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {foreach $deplist as $dep}
                        <tr>
                            <td>{$dep.id}</td>
                            <td>{$dep.dep_name}</td>
                            <td>
                                <a href="/wechatgroup/depadd/{$dep.id}/{$datatype}"><i class="fa fa-pencil fa-fw" style="font-size: 20px;" title="编辑"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                               &nbsp;
                                <a href="/wechatgroup/deldep/{$dep.id}" onclick="return confirm('确定要删除此{$datatype?"疾病":"科室"}？它的子级{$datatype?"疾病":"科室"}也会被删除!!!请慎重操作!!!')"><i class="fa fa-close" style="font-size: 20px;" title="删除"></i></a>

                            </td>
                        </tr>
                        {if $datatype==0&&$dep.childs}
                        {foreach $dep.childs as $item}
                        <tr>
                            <td>{$item.id}</td>
                            <td style="color:#8b8d97">——{$item.dep_name}</td>
                            <td>
                                <a href="/wechatgroup/depadd/{$item.id}"><i class="fa fa-pencil fa-fw" style="font-size: 20px;" title="编辑"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <a href="/wechatgroup/deps/{$item.id}"><i class="fa fa-list fa-fw" style="font-size: 20px;" title="疾病列表"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;
                                <a href="/wechatgroup/deldep/{$item.id}" onclick="return confirm('确定要删除此科室？请慎重操作!!!')"><i class="fa fa-close" style="font-size: 20px;" title="删除"></i></a>

                            </td>
                        </tr>
                        {/foreach}
                        {/if}
                        {/foreach}
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="row">
                <div class="col-md-9 ">
                    {$deplist?"":"暂无数据"}
                </div>

            </div>
        </div>
    </div>

</div>